﻿@using OBUCare.Web.Models
@using OBUCare.Core.Common
@using OBUCare.Web.Infrastructure
@model IEnumerable<ImportExcelDataViewModel>   
@{
    List<string> FaultNameList= ViewBag.FaultNameList as List<string>;
    
} 

@(Html.Telerik().Grid<ImportExcelDataViewModel>(Model)
        .Name("Grid")
        .DataBinding(dataBinding => dataBinding.Server())
        .Columns(columns =>
        {
            columns.Bound(o => o.ReturnDate).Format("{0:yyyy-MM-dd}");
            columns.Bound(o => o.RepairNo).Width("8%");
            columns.Bound(o => o.OBU_NO);
            columns.Bound(o => o.Fault1).Title(FaultNameList.GetValueTyIndex(0)).Visible(!FaultNameList.GetValueTyIndex(0).IsNullOrEmpty());
            columns.Bound(o => o.Fault2).Title(FaultNameList.GetValueTyIndex(1)).Visible(!FaultNameList.GetValueTyIndex(1).IsNullOrEmpty());
            columns.Bound(o => o.Fault3).Title(FaultNameList.GetValueTyIndex(2)).Visible(!FaultNameList.GetValueTyIndex(2).IsNullOrEmpty());
            columns.Bound(o => o.Fault4).Title(FaultNameList.GetValueTyIndex(3)).Visible(!FaultNameList.GetValueTyIndex(3).IsNullOrEmpty());
            columns.Bound(o => o.Fault5).Title(FaultNameList.GetValueTyIndex(4)).Visible(!FaultNameList.GetValueTyIndex(4).IsNullOrEmpty());
            columns.Bound(o => o.Fault6).Title(FaultNameList.GetValueTyIndex(5)).Visible(!FaultNameList.GetValueTyIndex(5).IsNullOrEmpty());
            columns.Bound(o => o.Fault7).Title(FaultNameList.GetValueTyIndex(6)).Visible(!FaultNameList.GetValueTyIndex(6).IsNullOrEmpty());
            columns.Bound(o => o.Fault8).Title(FaultNameList.GetValueTyIndex(7)).Visible(!FaultNameList.GetValueTyIndex(7).IsNullOrEmpty());
            columns.Bound(o => o.Fault9).Title(FaultNameList.GetValueTyIndex(8)).Visible(!FaultNameList.GetValueTyIndex(8).IsNullOrEmpty());
            columns.Bound(o => o.Fault10).Title(FaultNameList.GetValueTyIndex(9)).Visible(!FaultNameList.GetValueTyIndex(9).IsNullOrEmpty());
            columns.Bound(o => o.Fault11).Title(FaultNameList.GetValueTyIndex(10)).Visible(!FaultNameList.GetValueTyIndex(10).IsNullOrEmpty());
            columns.Bound(o => o.Fault12).Title(FaultNameList.GetValueTyIndex(11)).Visible(!FaultNameList.GetValueTyIndex(11).IsNullOrEmpty());
            columns.Bound(o => o.Fault13).Title(FaultNameList.GetValueTyIndex(12)).Visible(!FaultNameList.GetValueTyIndex(12).IsNullOrEmpty());
            columns.Bound(o => o.Fault14).Title(FaultNameList.GetValueTyIndex(13)).Visible(!FaultNameList.GetValueTyIndex(13).IsNullOrEmpty());
            columns.Bound(o => o.Fault15).Title(FaultNameList.GetValueTyIndex(14)).Visible(!FaultNameList.GetValueTyIndex(14).IsNullOrEmpty());
            columns.Bound(o => o.Fault16).Title(FaultNameList.GetValueTyIndex(15)).Visible(!FaultNameList.GetValueTyIndex(15).IsNullOrEmpty());
            columns.Bound(o => o.Fault17).Title(FaultNameList.GetValueTyIndex(16)).Visible(!FaultNameList.GetValueTyIndex(16).IsNullOrEmpty());
            columns.Bound(o => o.Fault18).Title(FaultNameList.GetValueTyIndex(17)).Visible(!FaultNameList.GetValueTyIndex(17).IsNullOrEmpty());
            columns.Bound(o => o.Fault19).Title(FaultNameList.GetValueTyIndex(18)).Visible(!FaultNameList.GetValueTyIndex(18).IsNullOrEmpty());
            columns.Bound(o => o.Fault20).Title(FaultNameList.GetValueTyIndex(19)).Visible(!FaultNameList.GetValueTyIndex(19).IsNullOrEmpty());
            columns.Bound(o => o.DISPOSE_TYPE);
            columns.Bound(o => o.remark);
        }).TableHtmlAttributes(new { @style="width:300%"})
        // .Resizable(resizing => resizing.Columns(true))
        .Footer(false)
        .Scrollable(scroll => scroll.Height(CommonStyleForUI.Grid_Height))
)
